/* ex04.c -- Write and test in a loop a function
 * that returns the number of times it has been called.
 */

#include <stdio.h>

int looped_func(void);

int main(void) {
  for (int i = 0; i < 100; ++i) {
    if (i % 3 == 0) {
      printf("called %d times.\n", looped_func());
    }
  }

  return 0;
}

int looped_func() {
  static int cnt = 0;
  return ++cnt;
}
